USE [Test_Events]
GO

SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[spGetAlerts]') AND type in (N'P', N'PC'))
DROP PROCEDURE [dbo].[spGetAlerts]
GO

CREATE PROCEDURE [dbo].[spGetAlerts]
AS
BEGIN
SELECT [Id]
      ,[CompanyAlertCompanyId] AS CompanyId
	  ,[AlertDate]
      ,[LevelOfImportance]
      ,[AlertType]
      ,[TypeOfChange]
      ,[Rationale]    
      ,[ResourceDataSerialized]
      ,[Created]
      ,[LastUpdated]
  FROM [Test_Events].[dbo].[Alerts]
  WHERE [SendToClients] = 1
END

